var rusent = "2021-7-1 14:08:56";
function format(rusent) {
    var d=new Date(rusent);
    var pastTime=d.getTime();
    var f=new Date();
    var nowTime=f.getTime();
    var absTime=(nowTime-pastTime)/1000;
    var d =parseInt(absTime/60/60/24); 
    var h =parseInt(absTime/60/60%24); 
    var m =parseInt(absTime/60%60); 
    var s =parseInt(absTime%60); 

    return d + '天' + h + '小时' + m + "分钟" + s + "秒";
}

console.log(format(rusent));